import logging
import redis


class Config(object):
    """公共配置"""
    # 配置数据库参数
    SQLALCHEMY_DATABASE_URI ='mysql://root:mysql@localhost/information9'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    # 配置redis数据库信息
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = '6379'
    # 配置session信息
    SECRET_KEY = 'm79IFHPviO6hzenUmZaLfWWIhGMlqWaY68b4Ro89NPc='
    SESSION_TYPE = 'redis'
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
    SESSION_USE_SIGNER = True
    SESSION_PERMANENT = 86400*2


class DevelopmentConfig(Config):
    """生产环境配置"""
    DEBUG = False
    LOG_LEVEL = logging.WARNING


class TestingConfig(Config):
    """测试环境配置"""
    DEBUG = True
    LOG_LEVEL = logging.DEBUG



